/**
 * Jaxson ajax
 *
 * Copyright Remedy Interactive, licensed under Apache version 2 license:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0.html
 *
 * This notice must remain in all java source files.
 */
package org.jaxson.struts.appconfig;


import java.io.IOException;
import java.util.Map;

import org.jaxson.config.ApplicationConfiguration;
import org.jaxson.struts.reverseAjax.ReverseAjaxEvent;


/**
 * Encapsulation of a configuration event which is pushed to the client
 * via Reverse Ajax.  When a configuration has changed this class
 * wraps the entire configuration for JSON serialization.
 * 
 * @author Joe Maisel
 */
public class ApplicationConfigurationEvent extends ReverseAjaxEvent
{
	public static final String EVENT_NAME = ApplicationConfigurationEvent.class.getSimpleName();

	public ApplicationConfigurationEvent ()
	{
		setName( EVENT_NAME );
	}

	public Map<String, Object> getConfiguration() throws IOException
	{
		return ApplicationConfiguration.getInstance().asMap();
	}

	private static final long serialVersionUID = 9837364527361L;
}
